/**
 *  Java Api For Ecco Generated Applications 
 *  
 *  Copyright (C) 2000  by PDTec GmbH 
 *
 * @author  Michael Weirich
 */

package pdtec.ecco.inst;

/** This class is used to describe the header information of step physical files.
 *  @see pdtec.ecco.inst.InstApplication#readFile(String ,int ,boolean, HeaderInfo)
 *  @see pdtec.ecco.inst.InstApplication#writeFile(String ,int ,String[],HeaderInfo )
 */
public class HeaderInfo {
    
    /** The description.*/ 
    public String[] description = null;
    /** The implementation level. */
    public String implementationLevel = null; 
    /** The name. */
    public String name = null;
    /** The time stamp. */
    public String timeStamp = null; 
    /** The author. */
    public String[] author = null;
    /** The organization. */
    public String[] organization = null;
    /** The preprocessor version. */
    public String preprocessorVersion = null;
    /** The originating system. */
    public String originatingSystem = null; 
    /** The authorization. */
    public String authorization = null;
    /** The schema identifiers. */
    public String[] schemaIdentifiers = null;
    /** The userdefined entities. */
    public String[] userdefinedEntities = null;
    
    /** Standard constructor. */
    public HeaderInfo() {
    } // constructor

    /** Prints string arrays. */
    public void printArray(String[] ar) {
	int i;
	for( i = 0; i < ar.length; i++)
	    System.out.println(ar[i]);
	System.out.println();
    } // printArray
    
    /** Prints the header info to the standard ouput channel. */
    public void print() {

	if(description != null) {
	    System.out.println("DESCRIPTION: ");
	    printArray(description);
	} // if
	
	if(implementationLevel != null) 
	    System.out.println("IMPLEMENTATION LEVEL: " + implementationLevel);

	if( name != null)
	    System.out.println("NAME: " + name);

	if(timeStamp != null)
	    System.out.println("TIME STAMP: " + timeStamp);

	if(author != null) {
	    System.out.println("AUTHOR: " );
	    printArray(author);
	} // if

	if(organization != null) {
	    System.out.println("ORGANIZATION: ");
	    printArray(organization);
	} // if

	if(preprocessorVersion != null)
	    System.out.println("PREPROCESSOR VERSION: " + preprocessorVersion);

	if(originatingSystem != null)
	    System.out.println("ORIGINATING SYSTEM: " + originatingSystem);

	if(authorization != null)
	    System.out.println("AUTHORIZATIOIN: " + authorization);

	if(schemaIdentifiers != null) {
	    System.out.println("SCHEMA IDENTIFIERS: ");
	    printArray(schemaIdentifiers);
	} // if

	if(userdefinedEntities != null) {
	    System.out.println("USERDEFINED ENTITIES: ");
	    printArray(userdefinedEntities);
	} // if

    } // print
    
    /** Finalizes the HeaderInfo object. */
    protected void finalize() {
	description = null;
	implementationLevel = null; 
	name = null;
	timeStamp = null; 
	author = null;
	organization = null;
	preprocessorVersion = null;
	originatingSystem = null; 
	authorization = null;
	schemaIdentifiers = null;
	userdefinedEntities = null;
    } // finalize

} // class HeaderInfo








